<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../statics/jquery-1.12.4/jquery-1.12.4.js"></script>
    <script>
        /*$(function(){
            $('#sub_btn').click(function () {
                var outTradeNo = document.getElementById("outTradeNo").value;
                var title = document.getElementById("title").value;
                var totalAmount = document.getElementById("totalAmount").value;

                var  son={
                    "outTradeNo":outTradeNo,
                    "title":title,
                    "totalAmount":totalAmount
                }
                $.ajax({
                    url : "/alipay/pay?"+Math.random(),
                    type : 'POST',
                    data : JSON.stringify(son),
                    contentType : 'application/json',
                    dataType: 'html',
                    success : function(data) {
                        console.log(data)
                        $("#return").append(data)
                    },
                    error: function(xhr, textStatus) {
                        console.log(xhr);
                        console.log(textStatus);
                    }
                });
            })
        })*/

    </script>
</head>
<body>
<H1>支付</H1>
<hr>
<div class="form-container">
    <form id="form" action="http://localhost:9000/alipay/pay" method="post">
        *商户订单 :
        <input type="text" name="outTradeNo" value="dzcp100010001" id="outTradeNo"><br>
        *订单名称 :
        <input type="text" name="title" value="辣条" id="title"><br>
        *付款金额 :
        <input type="text" name="totalAmount" value="0.1" id="totalAmount"><br>
        *商品描述 :
        <input type="text" name="body" value="卫龙辣条" id="body"><br>
        <input type="button" value="支付宝支付" id="sub_btn" onclick="submitForm()">
    </form>
</div>
<div id="return">

</div>

</body>

<script language="javascript">
    function submitForm() {
        document.getElementById("form").submit()
    }
</script>

<style>
    .form-container {
        padding-top:10px;
    }
    input {
        margin:10px;

    }
</style>
</html>